package com.example.vspm.mapper;

import com.example.vspm.entity.MeetingPlace;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author LCL
 * @date 2022/3/10
 * @desc
 */
@Repository
@Mapper
public interface MeetingPlaceMapper {

    //添加工单的会场//////////////
    @Insert("insert into vspm_meetingPlace (taid,category,arrivalTime,endTime,meetingPlace) values" +
            "(#{taid},#{category},#{arrivalTime},#{endTime},#{meetingPlace})")
    @Options(useGeneratedKeys=true, keyProperty="tid", keyColumn="tid")
    void addMeetingPlace(MeetingPlace meetingPlace);

//    //添加会场中的工单taid,tid是自增的会场id
//    @Update("update  vspm_meetingPlace set taid=#{taid} where tid=#{tid}" )
//    void addTaskFormTaid(@Param("taid") int taid, @Param("tid") int tid);



    //查看会场//////////////////
    //根据工单taid获取会场信息
    @Select("select * from vspm_meetingPlace where taid=#{taid}")
    List<MeetingPlace> listMeetingPlaceByTaid(int taid);

    //根据工单taid获取对应的会场id
    @Select("select tid from vspm_meetingPlace where taid=#{taid}")
    int getId(int taid);






}
